/*************************************************************/

#ifndef GLX_ARB_get_proc_address
typedef void (*__GLXextFuncPtr)(void);
#endif

#ifndef GLX_SGIX_video_source
typedef XID GLXVideoSourceSGIX;
#endif

#ifndef GLX_SGIX_fbconfig
typedef XID GLXFBConfigIDSGIX;
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
#endif

#ifndef GLX_SGIX_pbuffer
typedef XID GLXPbufferSGIX;
typedef struct {
    int type;
    unsigned long serial;	  /* # of last request processed by server */
    Bool send_event;		  /* true if this came for SendEvent request */
    Display *display;		  /* display the event was read from */
    GLXDrawable drawable;	  /* i.d. of Drawable */
    int event_type;		  /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
    int draw_type;		  /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
    unsigned int mask;	  /* mask indicating which buffers are affected*/
    int x, y;
    int width, height;
    int count;		  /* if nonzero, at least this many more */
} GLXBufferClobberEventSGIX;
#endif

#ifndef GLX_NV_video_output
typedef unsigned int GLXVideoDeviceNV;
#endif

#ifndef GLX_NV_video_capture
typedef XID GLXVideoCaptureDeviceNV;
#endif

#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GLX_OML_sync_control extension). */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(__sun__) || defined(__digital__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__) || defined(_LP64)
typedef long int int64_t;
typedef unsigned long int uint64_t;
#else
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
#elif defined( __VMS ) || defined(__sgi)
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#elif defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#elif defined(_WIN32) && defined(__GNUC__)
#include <stdint.h>
#elif defined(_WIN32)
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <inttypes.h>     /* Fallback option */
#endif
#endif

#define NAME_EMPTY(x)
#define FUNC_EMPTY(x, y, z, w, t)
#define END_EMPTY()
#define CONST_EMPTY(x, y, z)

#ifndef GLX_3DFX_multisample
#define GLX_3DFX_multisample 1
#define EXTENSION_GLX_3DFX_multisample(NAME, FUNC, CONST, END) \
	NAME(GLX_3DFX_multisample) \
	CONST(int, GLX_SAMPLE_BUFFERS_3DFX, 0x8050) \
	CONST(int, GLX_SAMPLES_3DFX, 0x8051) \
	END()
#else
#define EXTENSION_GLX_3DFX_multisample(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_AMD_gpu_association
#define GLX_AMD_gpu_association 1
#define EXTENSION_GLX_AMD_gpu_association(NAME, FUNC, CONST, END) \
	NAME(GLX_AMD_gpu_association) \
	CONST(int, GLX_GPU_VENDOR_AMD, 0x1F00) \
	CONST(int, GLX_GPU_RENDERER_STRING_AMD, 0x1F01) \
	CONST(int, GLX_GPU_OPENGL_VERSION_STRING_AMD, 0x1F02) \
	CONST(int, GLX_GPU_FASTEST_TARGET_GPUS_AMD, 0x21A2) \
	CONST(int, GLX_GPU_RAM_AMD, 0x21A3) \
	CONST(int, GLX_GPU_CLOCK_AMD, 0x21A4) \
	CONST(int, GLX_GPU_NUM_PIPES_AMD, 0x21A5) \
	CONST(int, GLX_GPU_NUM_SIMD_AMD, 0x21A6) \
	CONST(int, GLX_GPU_NUM_RB_AMD, 0x21A7) \
	CONST(int, GLX_GPU_NUM_SPI_AMD, 0x21A8) \
	END()
#else
#define EXTENSION_GLX_AMD_gpu_association(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_ARB_create_context
#define GLX_ARB_create_context 1
#define EXTENSION_GLX_ARB_create_context(NAME, FUNC, CONST, END) \
	NAME(GLX_ARB_create_context) \
	CONST(int, GLX_CONTEXT_DEBUG_BIT_ARB, 0x00000001) \
	CONST(int, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, 0x00000002) \
	CONST(int, GLX_CONTEXT_MAJOR_VERSION_ARB, 0x2091) \
	CONST(int, GLX_CONTEXT_MINOR_VERSION_ARB, 0x2092) \
	CONST(int, GLX_CONTEXT_FLAGS_ARB, 0x2094) \
	FUNC(GLXContext , glXCreateContextAttribsARB, GLXCREATECONTEXTATTRIBSARB, (Display * dpy , GLXFBConfig config , GLXContext share_context , Bool direct , const int * attrib_list ), (dpy, config, share_context, direct, attrib_list)) \
	END()
#else
#define EXTENSION_GLX_ARB_create_context(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_ARB_create_context_profile
#define GLX_ARB_create_context_profile 1
#define EXTENSION_GLX_ARB_create_context_profile(NAME, FUNC, CONST, END) \
	NAME(GLX_ARB_create_context_profile) \
	CONST(int, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, 0x00000001) \
	CONST(int, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, 0x00000002) \
	CONST(int, GLX_CONTEXT_PROFILE_MASK_ARB, 0x9126) \
	END()
#else
#define EXTENSION_GLX_ARB_create_context_profile(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_ARB_create_context_robustness
#define GLX_ARB_create_context_robustness 1
#define EXTENSION_GLX_ARB_create_context_robustness(NAME, FUNC, CONST, END) \
	NAME(GLX_ARB_create_context_robustness) \
	CONST(int, GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB, 0x00000004) \
	CONST(int, GLX_LOSE_CONTEXT_ON_RESET_ARB, 0x8252) \
	CONST(int, GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB, 0x8256) \
	CONST(int, GLX_NO_RESET_NOTIFICATION_ARB, 0x8261) \
	END()
#else
#define EXTENSION_GLX_ARB_create_context_robustness(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_ARB_fbconfig_float
#define GLX_ARB_fbconfig_float 1
#define EXTENSION_GLX_ARB_fbconfig_float(NAME, FUNC, CONST, END) \
	NAME(GLX_ARB_fbconfig_float) \
	CONST(int, GLX_RGBA_FLOAT_TYPE_ARB, 0x20B9) \
	CONST(int, GLX_RGBA_FLOAT_BIT_ARB, 0x00000004) \
	END()
#else
#define EXTENSION_GLX_ARB_fbconfig_float(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_ARB_framebuffer_sRGB
#define GLX_ARB_framebuffer_sRGB 1
#define EXTENSION_GLX_ARB_framebuffer_sRGB(NAME, FUNC, CONST, END) \
	NAME(GLX_ARB_framebuffer_sRGB) \
	CONST(int, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, 0x20B2) \
	END()
#else
#define EXTENSION_GLX_ARB_framebuffer_sRGB(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_ARB_get_proc_address
#define GLX_ARB_get_proc_address 1
#define EXTENSION_GLX_ARB_get_proc_address(NAME, FUNC, CONST, END) \
	NAME(GLX_ARB_get_proc_address) \
	FUNC(__GLXextFuncPtr , glXGetProcAddressARB, GLXGETPROCADDRESSARB, (const GLubyte * procName ), (procName)) \
	END()
#else
#define EXTENSION_GLX_ARB_get_proc_address(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_ARB_multisample
#define GLX_ARB_multisample 1
#define EXTENSION_GLX_ARB_multisample(NAME, FUNC, CONST, END) \
	NAME(GLX_ARB_multisample) \
	CONST(int, GLX_SAMPLE_BUFFERS_ARB, 100000) \
	CONST(int, GLX_SAMPLES_ARB, 100001) \
	END()
#else
#define EXTENSION_GLX_ARB_multisample(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_ARB_vertex_buffer_object
#define GLX_ARB_vertex_buffer_object 1
#define EXTENSION_GLX_ARB_vertex_buffer_object(NAME, FUNC, CONST, END) \
	NAME(GLX_ARB_vertex_buffer_object) \
	CONST(int, GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB, 0x2095) \
	END()
#else
#define EXTENSION_GLX_ARB_vertex_buffer_object(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_EXT_create_context_es2_profile
#define GLX_EXT_create_context_es2_profile 1
#define EXTENSION_GLX_EXT_create_context_es2_profile(NAME, FUNC, CONST, END) \
	NAME(GLX_EXT_create_context_es2_profile) \
	CONST(int, GLX_CONTEXT_ES2_PROFILE_BIT_EXT, 0x00000004) \
	END()
#else
#define EXTENSION_GLX_EXT_create_context_es2_profile(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_EXT_fbconfig_packed_float
#define GLX_EXT_fbconfig_packed_float 1
#define EXTENSION_GLX_EXT_fbconfig_packed_float(NAME, FUNC, CONST, END) \
	NAME(GLX_EXT_fbconfig_packed_float) \
	CONST(int, GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT, 0x20B1) \
	CONST(int, GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT, 0x00000008) \
	END()
#else
#define EXTENSION_GLX_EXT_fbconfig_packed_float(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_EXT_framebuffer_sRGB
#define GLX_EXT_framebuffer_sRGB 1
#define EXTENSION_GLX_EXT_framebuffer_sRGB(NAME, FUNC, CONST, END) \
	NAME(GLX_EXT_framebuffer_sRGB) \
	CONST(int, GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, 0x20B2) \
	END()
#else
#define EXTENSION_GLX_EXT_framebuffer_sRGB(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_EXT_import_context
#define GLX_EXT_import_context 1
#define EXTENSION_GLX_EXT_import_context(NAME, FUNC, CONST, END) \
	NAME(GLX_EXT_import_context) \
	CONST(int, GLX_SHARE_CONTEXT_EXT, 0x800A) \
	CONST(int, GLX_VISUAL_ID_EXT, 0x800B) \
	CONST(int, GLX_SCREEN_EXT, 0x800C) \
	FUNC(Display * , glXGetCurrentDisplayEXT, GLXGETCURRENTDISPLAYEXT, (void ), ()) \
	FUNC(int , glXQueryContextInfoEXT, GLXQUERYCONTEXTINFOEXT, (Display * dpy , GLXContext context , int attribute , int * value ), (dpy, context, attribute, value)) \
	FUNC(GLXContextID , glXGetContextIDEXT, GLXGETCONTEXTIDEXT, (const GLXContext context ), (context)) \
	FUNC(GLXContext , glXImportContextEXT, GLXIMPORTCONTEXTEXT, (Display * dpy , GLXContextID contextID ), (dpy, contextID)) \
	FUNC(void , glXFreeContextEXT, GLXFREECONTEXTEXT, (Display * dpy , GLXContext context ), (dpy, context)) \
	END()
#else
#define EXTENSION_GLX_EXT_import_context(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_EXT_swap_control
#define GLX_EXT_swap_control 1
#define EXTENSION_GLX_EXT_swap_control(NAME, FUNC, CONST, END) \
	NAME(GLX_EXT_swap_control) \
	CONST(int, GLX_SWAP_INTERVAL_EXT, 0x20F1) \
	CONST(int, GLX_MAX_SWAP_INTERVAL_EXT, 0x20F2) \
	FUNC(int , glXSwapIntervalEXT, GLXSWAPINTERVALEXT, (Display * dpy , GLXDrawable drawable , int interval ), (dpy, drawable, interval)) \
	END()
#else
#define EXTENSION_GLX_EXT_swap_control(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_EXT_texture_from_pixmap
#define GLX_EXT_texture_from_pixmap 1
#define EXTENSION_GLX_EXT_texture_from_pixmap(NAME, FUNC, CONST, END) \
	NAME(GLX_EXT_texture_from_pixmap) \
	CONST(int, GLX_TEXTURE_1D_BIT_EXT, 0x00000001) \
	CONST(int, GLX_TEXTURE_2D_BIT_EXT, 0x00000002) \
	CONST(int, GLX_TEXTURE_RECTANGLE_BIT_EXT, 0x00000004) \
	CONST(int, GLX_BIND_TO_TEXTURE_RGB_EXT, 0x20D0) \
	CONST(int, GLX_BIND_TO_TEXTURE_RGBA_EXT, 0x20D1) \
	CONST(int, GLX_BIND_TO_MIPMAP_TEXTURE_EXT, 0x20D2) \
	CONST(int, GLX_BIND_TO_TEXTURE_TARGETS_EXT, 0x20D3) \
	CONST(int, GLX_Y_INVERTED_EXT, 0x20D4) \
	CONST(int, GLX_TEXTURE_FORMAT_EXT, 0x20D5) \
	CONST(int, GLX_TEXTURE_TARGET_EXT, 0x20D6) \
	CONST(int, GLX_MIPMAP_TEXTURE_EXT, 0x20D7) \
	CONST(int, GLX_TEXTURE_FORMAT_NONE_EXT, 0x20D8) \
	CONST(int, GLX_TEXTURE_FORMAT_RGB_EXT, 0x20D9) \
	CONST(int, GLX_TEXTURE_FORMAT_RGBA_EXT, 0x20DA) \
	CONST(int, GLX_TEXTURE_1D_EXT, 0x20DB) \
	CONST(int, GLX_TEXTURE_2D_EXT, 0x20DC) \
	CONST(int, GLX_TEXTURE_RECTANGLE_EXT, 0x20DD) \
	CONST(int, GLX_FRONT_LEFT_EXT, 0x20DE) \
	CONST(int, GLX_FRONT_RIGHT_EXT, 0x20DF) \
	CONST(int, GLX_BACK_LEFT_EXT, 0x20E0) \
	CONST(int, GLX_BACK_RIGHT_EXT, 0x20E1) \
	CONST(int, GLX_FRONT_EXT, 0x20DE) \
	CONST(int, GLX_BACK_EXT, 0x20E0) \
	CONST(int, GLX_AUX0_EXT, 0x20E2) \
	CONST(int, GLX_AUX1_EXT, 0x20E3) \
	CONST(int, GLX_AUX2_EXT, 0x20E4) \
	CONST(int, GLX_AUX3_EXT, 0x20E5) \
	CONST(int, GLX_AUX4_EXT, 0x20E6) \
	CONST(int, GLX_AUX5_EXT, 0x20E7) \
	CONST(int, GLX_AUX6_EXT, 0x20E8) \
	CONST(int, GLX_AUX7_EXT, 0x20E9) \
	CONST(int, GLX_AUX8_EXT, 0x20EA) \
	CONST(int, GLX_AUX9_EXT, 0x20EB) \
	FUNC(void , glXBindTexImageEXT, GLXBINDTEXIMAGEEXT, (Display * dpy , GLXDrawable drawable , int buffer , const int * attrib_list ), (dpy, drawable, buffer, attrib_list)) \
	FUNC(void , glXReleaseTexImageEXT, GLXRELEASETEXIMAGEEXT, (Display * dpy , GLXDrawable drawable , int buffer ), (dpy, drawable, buffer)) \
	END()
#else
#define EXTENSION_GLX_EXT_texture_from_pixmap(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_EXT_visual_info
#define GLX_EXT_visual_info 1
#define EXTENSION_GLX_EXT_visual_info(NAME, FUNC, CONST, END) \
	NAME(GLX_EXT_visual_info) \
	CONST(int, GLX_X_VISUAL_TYPE_EXT, 0x22) \
	CONST(int, GLX_TRANSPARENT_TYPE_EXT, 0x23) \
	CONST(int, GLX_TRANSPARENT_INDEX_VALUE_EXT, 0x24) \
	CONST(int, GLX_TRANSPARENT_RED_VALUE_EXT, 0x25) \
	CONST(int, GLX_TRANSPARENT_GREEN_VALUE_EXT, 0x26) \
	CONST(int, GLX_TRANSPARENT_BLUE_VALUE_EXT, 0x27) \
	CONST(int, GLX_TRANSPARENT_ALPHA_VALUE_EXT, 0x28) \
	CONST(int, GLX_NONE_EXT, 0x8000) \
	CONST(int, GLX_TRUE_COLOR_EXT, 0x8002) \
	CONST(int, GLX_DIRECT_COLOR_EXT, 0x8003) \
	CONST(int, GLX_PSEUDO_COLOR_EXT, 0x8004) \
	CONST(int, GLX_STATIC_COLOR_EXT, 0x8005) \
	CONST(int, GLX_GRAY_SCALE_EXT, 0x8006) \
	CONST(int, GLX_STATIC_GRAY_EXT, 0x8007) \
	CONST(int, GLX_TRANSPARENT_RGB_EXT, 0x8008) \
	CONST(int, GLX_TRANSPARENT_INDEX_EXT, 0x8009) \
	END()
#else
#define EXTENSION_GLX_EXT_visual_info(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_EXT_visual_rating
#define GLX_EXT_visual_rating 1
#define EXTENSION_GLX_EXT_visual_rating(NAME, FUNC, CONST, END) \
	NAME(GLX_EXT_visual_rating) \
	CONST(int, GLX_VISUAL_CAVEAT_EXT, 0x20) \
	CONST(int, GLX_SLOW_VISUAL_EXT, 0x8001) \
	CONST(int, GLX_NON_CONFORMANT_VISUAL_EXT, 0x800D) \
	END()
#else
#define EXTENSION_GLX_EXT_visual_rating(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_INTEL_swap_event
#define GLX_INTEL_swap_event 1
#define EXTENSION_GLX_INTEL_swap_event(NAME, FUNC, CONST, END) \
	NAME(GLX_INTEL_swap_event) \
	CONST(int, GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK, 0x04000000) \
	CONST(int, GLX_EXCHANGE_COMPLETE_INTEL, 0x8180) \
	CONST(int, GLX_COPY_COMPLETE_INTEL, 0x8181) \
	CONST(int, GLX_FLIP_COMPLETE_INTEL, 0x8182) \
	END()
#else
#define EXTENSION_GLX_INTEL_swap_event(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_MESA_agp_offset
#define GLX_MESA_agp_offset 1
#define EXTENSION_GLX_MESA_agp_offset(NAME, FUNC, CONST, END) \
	NAME(GLX_MESA_agp_offset) \
	FUNC(unsigned int , glXGetAGPOffsetMESA, GLXGETAGPOFFSETMESA, (const void * pointer ), (pointer)) \
	END()
#else
#define EXTENSION_GLX_MESA_agp_offset(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_MESA_copy_sub_buffer
#define GLX_MESA_copy_sub_buffer 1
#define EXTENSION_GLX_MESA_copy_sub_buffer(NAME, FUNC, CONST, END) \
	NAME(GLX_MESA_copy_sub_buffer) \
	FUNC(void , glXCopySubBufferMESA, GLXCOPYSUBBUFFERMESA, (Display * dpy , GLXDrawable drawable , int x , int y , int width , int height ), (dpy, drawable, x, y, width, height)) \
	END()
#else
#define EXTENSION_GLX_MESA_copy_sub_buffer(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_MESA_pixmap_colormap
#define GLX_MESA_pixmap_colormap 1
#define EXTENSION_GLX_MESA_pixmap_colormap(NAME, FUNC, CONST, END) \
	NAME(GLX_MESA_pixmap_colormap) \
	FUNC(GLXPixmap , glXCreateGLXPixmapMESA, GLXCREATEGLXPIXMAPMESA, (Display * dpy , XVisualInfo * visual , Pixmap pixmap , Colormap cmap ), (dpy, visual, pixmap, cmap)) \
	END()
#else
#define EXTENSION_GLX_MESA_pixmap_colormap(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_MESA_release_buffers
#define GLX_MESA_release_buffers 1
#define EXTENSION_GLX_MESA_release_buffers(NAME, FUNC, CONST, END) \
	NAME(GLX_MESA_release_buffers) \
	FUNC(Bool , glXReleaseBuffersMESA, GLXRELEASEBUFFERSMESA, (Display * dpy , GLXDrawable drawable ), (dpy, drawable)) \
	END()
#else
#define EXTENSION_GLX_MESA_release_buffers(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_MESA_set_3dfx_mode
#define GLX_MESA_set_3dfx_mode 1
#define EXTENSION_GLX_MESA_set_3dfx_mode(NAME, FUNC, CONST, END) \
	NAME(GLX_MESA_set_3dfx_mode) \
	CONST(int, GLX_3DFX_WINDOW_MODE_MESA, 0x1) \
	CONST(int, GLX_3DFX_FULLSCREEN_MODE_MESA, 0x2) \
	FUNC(Bool , glXSet3DfxModeMESA, GLXSET3DFXMODEMESA, (int mode ), (mode)) \
	END()
#else
#define EXTENSION_GLX_MESA_set_3dfx_mode(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_NV_copy_image
#define GLX_NV_copy_image 1
#define EXTENSION_GLX_NV_copy_image(NAME, FUNC, CONST, END) \
	NAME(GLX_NV_copy_image) \
	FUNC(void , glXCopyImageSubDataNV, GLXCOPYIMAGESUBDATANV, (Display * dpy , GLXContext srcCtx , GLuint srcName , GLenum srcTarget , GLint srcLevel , GLint srcX , GLint srcY , GLint srcZ , GLXContext dstCtx , GLuint dstName , GLenum dstTarget , GLint dstLevel , GLint dstX , GLint dstY , GLint dstZ , GLsizei width , GLsizei height , GLsizei depth ), (dpy, srcCtx, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstCtx, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth)) \
	END()
#else
#define EXTENSION_GLX_NV_copy_image(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_NV_float_buffer
#define GLX_NV_float_buffer 1
#define EXTENSION_GLX_NV_float_buffer(NAME, FUNC, CONST, END) \
	NAME(GLX_NV_float_buffer) \
	CONST(int, GLX_FLOAT_COMPONENTS_NV, 0x20B0) \
	END()
#else
#define EXTENSION_GLX_NV_float_buffer(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_NV_multisample_coverage
#define GLX_NV_multisample_coverage 1
#define EXTENSION_GLX_NV_multisample_coverage(NAME, FUNC, CONST, END) \
	NAME(GLX_NV_multisample_coverage) \
	CONST(int, GLX_COVERAGE_SAMPLES_NV, 100001) \
	CONST(int, GLX_COLOR_SAMPLES_NV, 0x20B3) \
	END()
#else
#define EXTENSION_GLX_NV_multisample_coverage(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_NV_present_video
#define GLX_NV_present_video 1
#define EXTENSION_GLX_NV_present_video(NAME, FUNC, CONST, END) \
	NAME(GLX_NV_present_video) \
	CONST(int, GLX_NUM_VIDEO_SLOTS_NV, 0x20F0) \
	FUNC(unsigned int * , glXEnumerateVideoDevicesNV, GLXENUMERATEVIDEODEVICESNV, (Display * dpy , int screen , int * nelements ), (dpy, screen, nelements)) \
	FUNC(int , glXBindVideoDeviceNV, GLXBINDVIDEODEVICENV, (Display * dpy , unsigned int video_slot , unsigned int video_device , const int * attrib_list ), (dpy, video_slot, video_device, attrib_list)) \
	END()
#else
#define EXTENSION_GLX_NV_present_video(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_NV_swap_group
#define GLX_NV_swap_group 1
#define EXTENSION_GLX_NV_swap_group(NAME, FUNC, CONST, END) \
	NAME(GLX_NV_swap_group) \
	FUNC(Bool , glXJoinSwapGroupNV, GLXJOINSWAPGROUPNV, (Display * dpy , GLXDrawable drawable , GLuint group ), (dpy, drawable, group)) \
	FUNC(Bool , glXBindSwapBarrierNV, GLXBINDSWAPBARRIERNV, (Display * dpy , GLuint group , GLuint barrier ), (dpy, group, barrier)) \
	FUNC(Bool , glXQuerySwapGroupNV, GLXQUERYSWAPGROUPNV, (Display * dpy , GLXDrawable drawable , GLuint * group , GLuint * barrier ), (dpy, drawable, group, barrier)) \
	FUNC(Bool , glXQueryMaxSwapGroupsNV, GLXQUERYMAXSWAPGROUPSNV, (Display * dpy , int screen , GLuint * maxGroups , GLuint * maxBarriers ), (dpy, screen, maxGroups, maxBarriers)) \
	FUNC(Bool , glXQueryFrameCountNV, GLXQUERYFRAMECOUNTNV, (Display * dpy , int screen , GLuint * count ), (dpy, screen, count)) \
	FUNC(Bool , glXResetFrameCountNV, GLXRESETFRAMECOUNTNV, (Display * dpy , int screen ), (dpy, screen)) \
	END()
#else
#define EXTENSION_GLX_NV_swap_group(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_NV_video_capture
#define GLX_NV_video_capture 1
#define EXTENSION_GLX_NV_video_capture(NAME, FUNC, CONST, END) \
	NAME(GLX_NV_video_capture) \
	CONST(int, GLX_DEVICE_ID_NV, 0x20CD) \
	CONST(int, GLX_UNIQUE_ID_NV, 0x20CE) \
	CONST(int, GLX_NUM_VIDEO_CAPTURE_SLOTS_NV, 0x20CF) \
	FUNC(int , glXBindVideoCaptureDeviceNV, GLXBINDVIDEOCAPTUREDEVICENV, (Display * dpy , unsigned int video_capture_slot , GLXVideoCaptureDeviceNV device ), (dpy, video_capture_slot, device)) \
	FUNC(GLXVideoCaptureDeviceNV * , glXEnumerateVideoCaptureDevicesNV, GLXENUMERATEVIDEOCAPTUREDEVICESNV, (Display * dpy , int screen , int * nelements ), (dpy, screen, nelements)) \
	FUNC(void , glXLockVideoCaptureDeviceNV, GLXLOCKVIDEOCAPTUREDEVICENV, (Display * dpy , GLXVideoCaptureDeviceNV device ), (dpy, device)) \
	FUNC(int , glXQueryVideoCaptureDeviceNV, GLXQUERYVIDEOCAPTUREDEVICENV, (Display * dpy , GLXVideoCaptureDeviceNV device , int attribute , int * value ), (dpy, device, attribute, value)) \
	FUNC(void , glXReleaseVideoCaptureDeviceNV, GLXRELEASEVIDEOCAPTUREDEVICENV, (Display * dpy , GLXVideoCaptureDeviceNV device ), (dpy, device)) \
	END()
#else
#define EXTENSION_GLX_NV_video_capture(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_NV_video_out
#define GLX_NV_video_out 1
#define EXTENSION_GLX_NV_video_out(NAME, FUNC, CONST, END) \
	NAME(GLX_NV_video_out) \
	CONST(int, GLX_VIDEO_OUT_COLOR_NV, 0x20C3) \
	CONST(int, GLX_VIDEO_OUT_ALPHA_NV, 0x20C4) \
	CONST(int, GLX_VIDEO_OUT_DEPTH_NV, 0x20C5) \
	CONST(int, GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV, 0x20C6) \
	CONST(int, GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV, 0x20C7) \
	CONST(int, GLX_VIDEO_OUT_FRAME_NV, 0x20C8) \
	CONST(int, GLX_VIDEO_OUT_FIELD_1_NV, 0x20C9) \
	CONST(int, GLX_VIDEO_OUT_FIELD_2_NV, 0x20CA) \
	CONST(int, GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV, 0x20CB) \
	CONST(int, GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV, 0x20CC) \
	END()
#else
#define EXTENSION_GLX_NV_video_out(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_NV_video_output
#define GLX_NV_video_output 1
#define EXTENSION_GLX_NV_video_output(NAME, FUNC, CONST, END) \
	NAME(GLX_NV_video_output) \
	FUNC(int , glXGetVideoDeviceNV, GLXGETVIDEODEVICENV, (Display * dpy , int screen , int numVideoDevices , GLXVideoDeviceNV * pVideoDevice ), (dpy, screen, numVideoDevices, pVideoDevice)) \
	FUNC(int , glXReleaseVideoDeviceNV, GLXRELEASEVIDEODEVICENV, (Display * dpy , int screen , GLXVideoDeviceNV VideoDevice ), (dpy, screen, VideoDevice)) \
	FUNC(int , glXBindVideoImageNV, GLXBINDVIDEOIMAGENV, (Display * dpy , GLXVideoDeviceNV VideoDevice , GLXPbuffer pbuf , int iVideoBuffer ), (dpy, VideoDevice, pbuf, iVideoBuffer)) \
	FUNC(int , glXReleaseVideoImageNV, GLXRELEASEVIDEOIMAGENV, (Display * dpy , GLXPbuffer pbuf ), (dpy, pbuf)) \
	FUNC(int , glXSendPbufferToVideoNV, GLXSENDPBUFFERTOVIDEONV, (Display * dpy , GLXPbuffer pbuf , int iBufferType , unsigned long * pulCounterPbuffer , GLboolean bBlock ), (dpy, pbuf, iBufferType, pulCounterPbuffer, bBlock)) \
	FUNC(int , glXGetVideoInfoNV, GLXGETVIDEOINFONV, (Display * dpy , int screen , GLXVideoDeviceNV VideoDevice , unsigned long * pulCounterOutputPbuffer , unsigned long * pulCounterOutputVideo ), (dpy, screen, VideoDevice, pulCounterOutputPbuffer, pulCounterOutputVideo)) \
	END()
#else
#define EXTENSION_GLX_NV_video_output(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_OML_swap_method
#define GLX_OML_swap_method 1
#define EXTENSION_GLX_OML_swap_method(NAME, FUNC, CONST, END) \
	NAME(GLX_OML_swap_method) \
	CONST(int, GLX_SWAP_METHOD_OML, 0x8060) \
	CONST(int, GLX_SWAP_EXCHANGE_OML, 0x8061) \
	CONST(int, GLX_SWAP_COPY_OML, 0x8062) \
	CONST(int, GLX_SWAP_UNDEFINED_OML, 0x8063) \
	END()
#else
#define EXTENSION_GLX_OML_swap_method(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_OML_sync_control
#define GLX_OML_sync_control 1
#define EXTENSION_GLX_OML_sync_control(NAME, FUNC, CONST, END) \
	NAME(GLX_OML_sync_control) \
	FUNC(Bool , glXGetSyncValuesOML, GLXGETSYNCVALUESOML, (Display * dpy , GLXDrawable drawable , int64_t * ust , int64_t * msc , int64_t * sbc ), (dpy, drawable, ust, msc, sbc)) \
	FUNC(Bool , glXGetMscRateOML, GLXGETMSCRATEOML, (Display * dpy , GLXDrawable drawable , int32_t * numerator , int32_t * denominator ), (dpy, drawable, numerator, denominator)) \
	FUNC(int64_t , glXSwapBuffersMscOML, GLXSWAPBUFFERSMSCOML, (Display * dpy , GLXDrawable drawable , int64_t target_msc , int64_t divisor , int64_t remainder ), (dpy, drawable, target_msc, divisor, remainder)) \
	FUNC(Bool , glXWaitForMscOML, GLXWAITFORMSCOML, (Display * dpy , GLXDrawable drawable , int64_t target_msc , int64_t divisor , int64_t remainder , int64_t * ust , int64_t * msc , int64_t * sbc ), (dpy, drawable, target_msc, divisor, remainder, ust, msc, sbc)) \
	FUNC(Bool , glXWaitForSbcOML, GLXWAITFORSBCOML, (Display * dpy , GLXDrawable drawable , int64_t target_sbc , int64_t * ust , int64_t * msc , int64_t * sbc ), (dpy, drawable, target_sbc, ust, msc, sbc)) \
	END()
#else
#define EXTENSION_GLX_OML_sync_control(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIS_blended_overlay
#define GLX_SGIS_blended_overlay 1
#define EXTENSION_GLX_SGIS_blended_overlay(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIS_blended_overlay) \
	CONST(int, GLX_BLENDED_RGBA_SGIS, 0x8025) \
	END()
#else
#define EXTENSION_GLX_SGIS_blended_overlay(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIS_multisample
#define GLX_SGIS_multisample 1
#define EXTENSION_GLX_SGIS_multisample(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIS_multisample) \
	CONST(int, GLX_SAMPLE_BUFFERS_SGIS, 100000) \
	CONST(int, GLX_SAMPLES_SGIS, 100001) \
	END()
#else
#define EXTENSION_GLX_SGIS_multisample(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIS_shared_multisample
#define GLX_SGIS_shared_multisample 1
#define EXTENSION_GLX_SGIS_shared_multisample(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIS_shared_multisample) \
	CONST(int, GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS, 0x8026) \
	CONST(int, GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS, 0x8027) \
	END()
#else
#define EXTENSION_GLX_SGIS_shared_multisample(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_dmbuffer
#define GLX_SGIX_dmbuffer 1
#define EXTENSION_GLX_SGIX_dmbuffer(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_dmbuffer) \
	CONST(int, GLX_DIGITAL_MEDIA_PBUFFER_SGIX, 0x8024) \
	END()
#else
#define EXTENSION_GLX_SGIX_dmbuffer(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_fbconfig
#define GLX_SGIX_fbconfig 1
#define EXTENSION_GLX_SGIX_fbconfig(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_fbconfig) \
	CONST(int, GLX_WINDOW_BIT_SGIX, 0x00000001) \
	CONST(int, GLX_PIXMAP_BIT_SGIX, 0x00000002) \
	CONST(int, GLX_RGBA_BIT_SGIX, 0x00000001) \
	CONST(int, GLX_COLOR_INDEX_BIT_SGIX, 0x00000002) \
	CONST(int, GLX_DRAWABLE_TYPE_SGIX, 0x8010) \
	CONST(int, GLX_RENDER_TYPE_SGIX, 0x8011) \
	CONST(int, GLX_X_RENDERABLE_SGIX, 0x8012) \
	CONST(int, GLX_FBCONFIG_ID_SGIX, 0x8013) \
	CONST(int, GLX_RGBA_TYPE_SGIX, 0x8014) \
	CONST(int, GLX_COLOR_INDEX_TYPE_SGIX, 0x8015) \
	FUNC(int , glXGetFBConfigAttribSGIX, GLXGETFBCONFIGATTRIBSGIX, (Display * dpy , GLXFBConfigSGIX config , int attribute , int * value ), (dpy, config, attribute, value)) \
	FUNC(GLXFBConfigSGIX * , glXChooseFBConfigSGIX, GLXCHOOSEFBCONFIGSGIX, (Display * dpy , int screen , int * attrib_list , int * nelements ), (dpy, screen, attrib_list, nelements)) \
	FUNC(GLXPixmap , glXCreateGLXPixmapWithConfigSGIX, GLXCREATEGLXPIXMAPWITHCONFIGSGIX, (Display * dpy , GLXFBConfigSGIX config , Pixmap pixmap ), (dpy, config, pixmap)) \
	FUNC(GLXContext , glXCreateContextWithConfigSGIX, GLXCREATECONTEXTWITHCONFIGSGIX, (Display * dpy , GLXFBConfigSGIX config , int render_type , GLXContext share_list , Bool direct ), (dpy, config, render_type, share_list, direct)) \
	FUNC(XVisualInfo * , glXGetVisualFromFBConfigSGIX, GLXGETVISUALFROMFBCONFIGSGIX, (Display * dpy , GLXFBConfigSGIX config ), (dpy, config)) \
	FUNC(GLXFBConfigSGIX , glXGetFBConfigFromVisualSGIX, GLXGETFBCONFIGFROMVISUALSGIX, (Display * dpy , XVisualInfo * vis ), (dpy, vis)) \
	END()
#else
#define EXTENSION_GLX_SGIX_fbconfig(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_hyperpipe
#define GLX_SGIX_hyperpipe 1
#define EXTENSION_GLX_SGIX_hyperpipe(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_hyperpipe) \
	CONST(int, GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX, 80) \
	CONST(int, GLX_BAD_HYPERPIPE_CONFIG_SGIX, 91) \
	CONST(int, GLX_BAD_HYPERPIPE_SGIX, 92) \
	CONST(int, GLX_HYPERPIPE_DISPLAY_PIPE_SGIX, 0x00000001) \
	CONST(int, GLX_HYPERPIPE_RENDER_PIPE_SGIX, 0x00000002) \
	CONST(int, GLX_PIPE_RECT_SGIX, 0x00000001) \
	CONST(int, GLX_PIPE_RECT_LIMITS_SGIX, 0x00000002) \
	CONST(int, GLX_HYPERPIPE_STEREO_SGIX, 0x00000003) \
	CONST(int, GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX, 0x00000004) \
	CONST(int, GLX_HYPERPIPE_ID_SGIX, 0x8030) \
	END()
#else
#define EXTENSION_GLX_SGIX_hyperpipe(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_pbuffer
#define GLX_SGIX_pbuffer 1
#define EXTENSION_GLX_SGIX_pbuffer(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_pbuffer) \
	CONST(int, GLX_PBUFFER_BIT_SGIX, 0x00000004) \
	CONST(int, GLX_BUFFER_CLOBBER_MASK_SGIX, 0x08000000) \
	CONST(int, GLX_FRONT_LEFT_BUFFER_BIT_SGIX, 0x00000001) \
	CONST(int, GLX_FRONT_RIGHT_BUFFER_BIT_SGIX, 0x00000002) \
	CONST(int, GLX_BACK_LEFT_BUFFER_BIT_SGIX, 0x00000004) \
	CONST(int, GLX_BACK_RIGHT_BUFFER_BIT_SGIX, 0x00000008) \
	CONST(int, GLX_AUX_BUFFERS_BIT_SGIX, 0x00000010) \
	CONST(int, GLX_DEPTH_BUFFER_BIT_SGIX, 0x00000020) \
	CONST(int, GLX_STENCIL_BUFFER_BIT_SGIX, 0x00000040) \
	CONST(int, GLX_ACCUM_BUFFER_BIT_SGIX, 0x00000080) \
	CONST(int, GLX_SAMPLE_BUFFERS_BIT_SGIX, 0x00000100) \
	CONST(int, GLX_MAX_PBUFFER_WIDTH_SGIX, 0x8016) \
	CONST(int, GLX_MAX_PBUFFER_HEIGHT_SGIX, 0x8017) \
	CONST(int, GLX_MAX_PBUFFER_PIXELS_SGIX, 0x8018) \
	CONST(int, GLX_OPTIMAL_PBUFFER_WIDTH_SGIX, 0x8019) \
	CONST(int, GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX, 0x801A) \
	CONST(int, GLX_PRESERVED_CONTENTS_SGIX, 0x801B) \
	CONST(int, GLX_LARGEST_PBUFFER_SGIX, 0x801C) \
	CONST(int, GLX_WIDTH_SGIX, 0x801D) \
	CONST(int, GLX_HEIGHT_SGIX, 0x801E) \
	CONST(int, GLX_EVENT_MASK_SGIX, 0x801F) \
	CONST(int, GLX_DAMAGED_SGIX, 0x8020) \
	CONST(int, GLX_SAVED_SGIX, 0x8021) \
	CONST(int, GLX_WINDOW_SGIX, 0x8022) \
	CONST(int, GLX_PBUFFER_SGIX, 0x8023) \
	FUNC(GLXPbufferSGIX , glXCreateGLXPbufferSGIX, GLXCREATEGLXPBUFFERSGIX, (Display * dpy , GLXFBConfigSGIX config , unsigned int width , unsigned int height , int * attrib_list ), (dpy, config, width, height, attrib_list)) \
	FUNC(void , glXDestroyGLXPbufferSGIX, GLXDESTROYGLXPBUFFERSGIX, (Display * dpy , GLXPbufferSGIX pbuf ), (dpy, pbuf)) \
	FUNC(int , glXQueryGLXPbufferSGIX, GLXQUERYGLXPBUFFERSGIX, (Display * dpy , GLXPbufferSGIX pbuf , int attribute , unsigned int * value ), (dpy, pbuf, attribute, value)) \
	FUNC(void , glXSelectEventSGIX, GLXSELECTEVENTSGIX, (Display * dpy , GLXDrawable drawable , unsigned long mask ), (dpy, drawable, mask)) \
	FUNC(void , glXGetSelectedEventSGIX, GLXGETSELECTEDEVENTSGIX, (Display * dpy , GLXDrawable drawable , unsigned long * mask ), (dpy, drawable, mask)) \
	END()
#else
#define EXTENSION_GLX_SGIX_pbuffer(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_swap_barrier
#define GLX_SGIX_swap_barrier 1
#define EXTENSION_GLX_SGIX_swap_barrier(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_swap_barrier) \
	FUNC(void , glXBindSwapBarrierSGIX, GLXBINDSWAPBARRIERSGIX, (Display * dpy , GLXDrawable drawable , int barrier ), (dpy, drawable, barrier)) \
	FUNC(Bool , glXQueryMaxSwapBarriersSGIX, GLXQUERYMAXSWAPBARRIERSSGIX, (Display * dpy , int screen , int * max ), (dpy, screen, max)) \
	END()
#else
#define EXTENSION_GLX_SGIX_swap_barrier(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_swap_group
#define GLX_SGIX_swap_group 1
#define EXTENSION_GLX_SGIX_swap_group(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_swap_group) \
	FUNC(void , glXJoinSwapGroupSGIX, GLXJOINSWAPGROUPSGIX, (Display * dpy , GLXDrawable drawable , GLXDrawable member ), (dpy, drawable, member)) \
	END()
#else
#define EXTENSION_GLX_SGIX_swap_group(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_video_resize
#define GLX_SGIX_video_resize 1
#define EXTENSION_GLX_SGIX_video_resize(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_video_resize) \
	CONST(int, GLX_SYNC_FRAME_SGIX, 0x00000000) \
	CONST(int, GLX_SYNC_SWAP_SGIX, 0x00000001) \
	FUNC(int , glXBindChannelToWindowSGIX, GLXBINDCHANNELTOWINDOWSGIX, (Display * display , int screen , int channel , Window window ), (display, screen, channel, window)) \
	FUNC(int , glXChannelRectSGIX, GLXCHANNELRECTSGIX, (Display * display , int screen , int channel , int x , int y , int w , int h ), (display, screen, channel, x, y, w, h)) \
	FUNC(int , glXQueryChannelRectSGIX, GLXQUERYCHANNELRECTSGIX, (Display * display , int screen , int channel , int * dx , int * dy , int * dw , int * dh ), (display, screen, channel, dx, dy, dw, dh)) \
	FUNC(int , glXQueryChannelDeltasSGIX, GLXQUERYCHANNELDELTASSGIX, (Display * display , int screen , int channel , int * x , int * y , int * w , int * h ), (display, screen, channel, x, y, w, h)) \
	FUNC(int , glXChannelRectSyncSGIX, GLXCHANNELRECTSYNCSGIX, (Display * display , int screen , int channel , GLenum synctype ), (display, screen, channel, synctype)) \
	END()
#else
#define EXTENSION_GLX_SGIX_video_resize(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_video_source
#define GLX_SGIX_video_source 1
#define EXTENSION_GLX_SGIX_video_source(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_video_source) \
	END()
#else
#define EXTENSION_GLX_SGIX_video_source(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGIX_visual_select_group
#define GLX_SGIX_visual_select_group 1
#define EXTENSION_GLX_SGIX_visual_select_group(NAME, FUNC, CONST, END) \
	NAME(GLX_SGIX_visual_select_group) \
	CONST(int, GLX_VISUAL_SELECT_GROUP_SGIX, 0x8028) \
	END()
#else
#define EXTENSION_GLX_SGIX_visual_select_group(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGI_cushion
#define GLX_SGI_cushion 1
#define EXTENSION_GLX_SGI_cushion(NAME, FUNC, CONST, END) \
	NAME(GLX_SGI_cushion) \
	FUNC(void , glXCushionSGI, GLXCUSHIONSGI, (Display * dpy , Window window , float cushion ), (dpy, window, cushion)) \
	END()
#else
#define EXTENSION_GLX_SGI_cushion(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGI_make_current_read
#define GLX_SGI_make_current_read 1
#define EXTENSION_GLX_SGI_make_current_read(NAME, FUNC, CONST, END) \
	NAME(GLX_SGI_make_current_read) \
	FUNC(Bool , glXMakeCurrentReadSGI, GLXMAKECURRENTREADSGI, (Display * dpy , GLXDrawable draw , GLXDrawable read , GLXContext ctx ), (dpy, draw, read, ctx)) \
	FUNC(GLXDrawable , glXGetCurrentReadDrawableSGI, GLXGETCURRENTREADDRAWABLESGI, (void ), ()) \
	END()
#else
#define EXTENSION_GLX_SGI_make_current_read(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGI_swap_control
#define GLX_SGI_swap_control 1
#define EXTENSION_GLX_SGI_swap_control(NAME, FUNC, CONST, END) \
	NAME(GLX_SGI_swap_control) \
	FUNC(int , glXSwapIntervalSGI, GLXSWAPINTERVALSGI, (int interval ), (interval)) \
	END()
#else
#define EXTENSION_GLX_SGI_swap_control(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SGI_video_sync
#define GLX_SGI_video_sync 1
#define EXTENSION_GLX_SGI_video_sync(NAME, FUNC, CONST, END) \
	NAME(GLX_SGI_video_sync) \
	FUNC(int , glXGetVideoSyncSGI, GLXGETVIDEOSYNCSGI, (unsigned int * count ), (count)) \
	FUNC(int , glXWaitVideoSyncSGI, GLXWAITVIDEOSYNCSGI, (int divisor , int remainder , unsigned int * count ), (divisor, remainder, count)) \
	END()
#else
#define EXTENSION_GLX_SGI_video_sync(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_SUN_get_transparent_index
#define GLX_SUN_get_transparent_index 1
#define EXTENSION_GLX_SUN_get_transparent_index(NAME, FUNC, CONST, END) \
	NAME(GLX_SUN_get_transparent_index) \
	FUNC(Status , glXGetTransparentIndexSUN, GLXGETTRANSPARENTINDEXSUN, (Display * dpy , Window overlay , Window underlay , long * pTransparentIndex ), (dpy, overlay, underlay, pTransparentIndex)) \
	END()
#else
#define EXTENSION_GLX_SUN_get_transparent_index(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_VERSION_1_3
#define GLX_VERSION_1_3 1
#define EXTENSION_GLX_VERSION_1_3(NAME, FUNC, CONST, END) \
	NAME(GLX_VERSION_1_3) \
	CONST(int, GLX_WINDOW_BIT, 0x00000001) \
	CONST(int, GLX_PIXMAP_BIT, 0x00000002) \
	CONST(int, GLX_PBUFFER_BIT, 0x00000004) \
	CONST(int, GLX_RGBA_BIT, 0x00000001) \
	CONST(int, GLX_COLOR_INDEX_BIT, 0x00000002) \
	CONST(int, GLX_PBUFFER_CLOBBER_MASK, 0x08000000) \
	CONST(int, GLX_FRONT_LEFT_BUFFER_BIT, 0x00000001) \
	CONST(int, GLX_FRONT_RIGHT_BUFFER_BIT, 0x00000002) \
	CONST(int, GLX_BACK_LEFT_BUFFER_BIT, 0x00000004) \
	CONST(int, GLX_BACK_RIGHT_BUFFER_BIT, 0x00000008) \
	CONST(int, GLX_AUX_BUFFERS_BIT, 0x00000010) \
	CONST(int, GLX_DEPTH_BUFFER_BIT, 0x00000020) \
	CONST(int, GLX_STENCIL_BUFFER_BIT, 0x00000040) \
	CONST(int, GLX_ACCUM_BUFFER_BIT, 0x00000080) \
	CONST(int, GLX_CONFIG_CAVEAT, 0x20) \
	CONST(int, GLX_X_VISUAL_TYPE, 0x22) \
	CONST(int, GLX_TRANSPARENT_TYPE, 0x23) \
	CONST(int, GLX_TRANSPARENT_INDEX_VALUE, 0x24) \
	CONST(int, GLX_TRANSPARENT_RED_VALUE, 0x25) \
	CONST(int, GLX_TRANSPARENT_GREEN_VALUE, 0x26) \
	CONST(int, GLX_TRANSPARENT_BLUE_VALUE, 0x27) \
	CONST(int, GLX_TRANSPARENT_ALPHA_VALUE, 0x28) \
	CONST(int, GLX_DONT_CARE, 0xFFFFFFFF) \
	CONST(int, GLX_NONE, 0x8000) \
	CONST(int, GLX_SLOW_CONFIG, 0x8001) \
	CONST(int, GLX_TRUE_COLOR, 0x8002) \
	CONST(int, GLX_DIRECT_COLOR, 0x8003) \
	CONST(int, GLX_PSEUDO_COLOR, 0x8004) \
	CONST(int, GLX_STATIC_COLOR, 0x8005) \
	CONST(int, GLX_GRAY_SCALE, 0x8006) \
	CONST(int, GLX_STATIC_GRAY, 0x8007) \
	CONST(int, GLX_TRANSPARENT_RGB, 0x8008) \
	CONST(int, GLX_TRANSPARENT_INDEX, 0x8009) \
	CONST(int, GLX_VISUAL_ID, 0x800B) \
	CONST(int, GLX_SCREEN, 0x800C) \
	CONST(int, GLX_NON_CONFORMANT_CONFIG, 0x800D) \
	CONST(int, GLX_DRAWABLE_TYPE, 0x8010) \
	CONST(int, GLX_RENDER_TYPE, 0x8011) \
	CONST(int, GLX_X_RENDERABLE, 0x8012) \
	CONST(int, GLX_FBCONFIG_ID, 0x8013) \
	CONST(int, GLX_RGBA_TYPE, 0x8014) \
	CONST(int, GLX_COLOR_INDEX_TYPE, 0x8015) \
	CONST(int, GLX_MAX_PBUFFER_WIDTH, 0x8016) \
	CONST(int, GLX_MAX_PBUFFER_HEIGHT, 0x8017) \
	CONST(int, GLX_MAX_PBUFFER_PIXELS, 0x8018) \
	CONST(int, GLX_PRESERVED_CONTENTS, 0x801B) \
	CONST(int, GLX_LARGEST_PBUFFER, 0x801C) \
	CONST(int, GLX_WIDTH, 0x801D) \
	CONST(int, GLX_HEIGHT, 0x801E) \
	CONST(int, GLX_EVENT_MASK, 0x801F) \
	CONST(int, GLX_DAMAGED, 0x8020) \
	CONST(int, GLX_SAVED, 0x8021) \
	CONST(int, GLX_WINDOW, 0x8022) \
	CONST(int, GLX_PBUFFER, 0x8023) \
	CONST(int, GLX_PBUFFER_HEIGHT, 0x8040) \
	CONST(int, GLX_PBUFFER_WIDTH, 0x8041) \
	FUNC(GLXFBConfig * , glXGetFBConfigs, GLXGETFBCONFIGS, (Display * dpy , int screen , int * nelements ), (dpy, screen, nelements)) \
	FUNC(GLXFBConfig * , glXChooseFBConfig, GLXCHOOSEFBCONFIG, (Display * dpy , int screen , const int * attrib_list , int * nelements ), (dpy, screen, attrib_list, nelements)) \
	FUNC(int , glXGetFBConfigAttrib, GLXGETFBCONFIGATTRIB, (Display * dpy , GLXFBConfig config , int attribute , int * value ), (dpy, config, attribute, value)) \
	FUNC(XVisualInfo * , glXGetVisualFromFBConfig, GLXGETVISUALFROMFBCONFIG, (Display * dpy , GLXFBConfig config ), (dpy, config)) \
	FUNC(GLXWindow , glXCreateWindow, GLXCREATEWINDOW, (Display * dpy , GLXFBConfig config , Window win , const int * attrib_list ), (dpy, config, win, attrib_list)) \
	FUNC(void , glXDestroyWindow, GLXDESTROYWINDOW, (Display * dpy , GLXWindow win ), (dpy, win)) \
	FUNC(GLXPixmap , glXCreatePixmap, GLXCREATEPIXMAP, (Display * dpy , GLXFBConfig config , Pixmap pixmap , const int * attrib_list ), (dpy, config, pixmap, attrib_list)) \
	FUNC(void , glXDestroyPixmap, GLXDESTROYPIXMAP, (Display * dpy , GLXPixmap pixmap ), (dpy, pixmap)) \
	FUNC(GLXPbuffer , glXCreatePbuffer, GLXCREATEPBUFFER, (Display * dpy , GLXFBConfig config , const int * attrib_list ), (dpy, config, attrib_list)) \
	FUNC(void , glXDestroyPbuffer, GLXDESTROYPBUFFER, (Display * dpy , GLXPbuffer pbuf ), (dpy, pbuf)) \
	FUNC(void , glXQueryDrawable, GLXQUERYDRAWABLE, (Display * dpy , GLXDrawable draw , int attribute , unsigned int * value ), (dpy, draw, attribute, value)) \
	FUNC(GLXContext , glXCreateNewContext, GLXCREATENEWCONTEXT, (Display * dpy , GLXFBConfig config , int render_type , GLXContext share_list , Bool direct ), (dpy, config, render_type, share_list, direct)) \
	FUNC(Bool , glXMakeContextCurrent, GLXMAKECONTEXTCURRENT, (Display * dpy , GLXDrawable draw , GLXDrawable read , GLXContext ctx ), (dpy, draw, read, ctx)) \
	FUNC(GLXDrawable , glXGetCurrentReadDrawable, GLXGETCURRENTREADDRAWABLE, (void ), ()) \
	FUNC(Display * , glXGetCurrentDisplay, GLXGETCURRENTDISPLAY, (void ), ()) \
	FUNC(int , glXQueryContext, GLXQUERYCONTEXT, (Display * dpy , GLXContext ctx , int attribute , int * value ), (dpy, ctx, attribute, value)) \
	FUNC(void , glXSelectEvent, GLXSELECTEVENT, (Display * dpy , GLXDrawable draw , unsigned long event_mask ), (dpy, draw, event_mask)) \
	FUNC(void , glXGetSelectedEvent, GLXGETSELECTEDEVENT, (Display * dpy , GLXDrawable draw , unsigned long * event_mask ), (dpy, draw, event_mask)) \
	END()
#else
#define EXTENSION_GLX_VERSION_1_3(NAME, FUNC, CONST, END)
#endif

#ifndef GLX_VERSION_1_4
#define GLX_VERSION_1_4 1
#define EXTENSION_GLX_VERSION_1_4(NAME, FUNC, CONST, END) \
	NAME(GLX_VERSION_1_4) \
	CONST(int, GLX_SAMPLE_BUFFERS, 100000) \
	CONST(int, GLX_SAMPLES, 100001) \
	FUNC(__GLXextFuncPtr , glXGetProcAddress, GLXGETPROCADDRESS, (const GLubyte * procName ), (procName)) \
	END()
#else
#define EXTENSION_GLX_VERSION_1_4(NAME, FUNC, CONST, END)
#endif

#define ALL_EXTENSIONS(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_3DFX_multisample(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_AMD_gpu_association(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_ARB_create_context(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_ARB_create_context_profile(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_ARB_create_context_robustness(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_ARB_fbconfig_float(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_ARB_framebuffer_sRGB(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_ARB_get_proc_address(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_ARB_multisample(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_ARB_vertex_buffer_object(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_EXT_create_context_es2_profile(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_EXT_fbconfig_packed_float(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_EXT_framebuffer_sRGB(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_EXT_import_context(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_EXT_swap_control(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_EXT_texture_from_pixmap(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_EXT_visual_info(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_EXT_visual_rating(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_INTEL_swap_event(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_MESA_agp_offset(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_MESA_copy_sub_buffer(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_MESA_pixmap_colormap(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_MESA_release_buffers(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_MESA_set_3dfx_mode(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_NV_copy_image(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_NV_float_buffer(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_NV_multisample_coverage(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_NV_present_video(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_NV_swap_group(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_NV_video_capture(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_NV_video_out(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_NV_video_output(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_OML_swap_method(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_OML_sync_control(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIS_blended_overlay(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIS_multisample(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIS_shared_multisample(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_dmbuffer(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_fbconfig(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_hyperpipe(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_pbuffer(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_swap_barrier(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_swap_group(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_video_resize(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_video_source(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGIX_visual_select_group(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGI_cushion(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGI_make_current_read(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGI_swap_control(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SGI_video_sync(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_SUN_get_transparent_index(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_VERSION_1_3(NAME, FUNC, CONST, END) \
	EXTENSION_GLX_VERSION_1_4(NAME, FUNC, CONST, END) \

#define ONLY_VERSION MAX_VERSION_EXTENSIONS
#define VERSION_EXTENSIONS(NAME, FUNC, CONST, END) \

#define ARB_EXTENSIONS(NAME, FUNC, CONST, END) \

#define EXT_EXTENSIONS(NAME, FUNC, CONST, END) \

#define IMPORTANT_EXTENSIONS(NAME, FUNC, CONST, END) \
	MAX_VERSION_EXTENSIONS(NAME, FUNC, CONST, END) \

#define CRITICAL_EXTENSIONS(NAME, FUNC, CONST, END) \
	MAX_VERSION_EXTENSIONS(NAME, FUNC, CONST, END) \
